home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / pascal / mkfmx.exe / MKFMX.DOC < prev    next >
Encoding:
Text File  |  1992-11-21  |  7.5 KB  |  198 lines

  1.                     MkFmx File manager Extension
  2.                     ----------------------------
  3.  
  4. OverView
  5. --------
  6.  
  7. This is a little test utility that I wrote in order to test the File
  8. manager extensions. However, I feel that other people might benefit
  9. from this, therefore I am uploading it here. The source, in turbo
  10. Pascal is included for anybody who wants to see how a file manager
  11. extension is done.
  12.  
  13. This is freeware, so do whatever you want with it. I am (obviously)
  14. not providing any support, but would be very interested in any bugs
  15. or problems you may find. Please drop me a note at CIS 100012,1767
  16. Also, I would be interested to know if anybody actually finds this
  17. usefull. I fyou drop me a friendly note (at the above address), I
  18. will be encouraged to upload more of the utilities I will be
  19. developing.
  20.  
  21. What it does
  22. ------------
  23.  
  24. Basically, Mkfmx adds a new menu item to the standard File Manager
  25. menu. This new menu contains items which you, the user defines, and
  26. which correspond to programs. When a selection is made from this
  27. menu, the corresponding program is launched. The interesting feature
  28. is that, if one (or more) files are selected when the program gets
  29. launched, the program will receive these filenames as parameters.
  30. Many programs take filenames as parameters and act on them. The most
  31. trivial example is NOTEPAD, the default windows editor. If called
  32. with a filename parameter, it will just edit the file.
  33.  
  34. The result is that, effectively you add new file proccessing commands
  35. to File manager.
  36. Any executable program can be attached to the menu entries, even
  37. DOS programs. Actually, there are many more DOS programs that take
  38. filename parameters than Windows programs, so I expect that this
  39. utility will be most used with DOS programs.
  40.  
  41. By the way, we all know that windows allows you to assosiate
  42. particular file name extensions with a program, so you could,
  43. for example, associate an extension with a particular program,
  44. and just double-click on the filename to launch the program with
  45. the file as parameter. So why bother with MkFmx ?
  46.  
  47. The answer is simple. If a particular file type can only be processed
  48. by one program, the above trick is enough. However, there are many
  49. cases that you need to associate a particular file type with more
  50. than one programs. Take for example the BMP format. Paintbrush deals
  51. with these files, but so do dozens of other programs. Which one should
  52. you associate with the BMP extension? The answer is, the most
  53. common. Then , if you want to process the file by another program,
  54. just add the program to mkfmx's menu, select the file, and select
  55. the corresponding command from the menu.
  56.  
  57. Installation
  58. ------------
  59.  
  60. To install MkFmx do the following:
  61.  
  62. 1. Copy the file MKFMX.DLL wherever you want (the windows directory
  63. will do).
  64.  
  65. 2. Edit the WINFILE.INI file (notepad can do that), and add the
  66. following sections:
  67.  
  68. [AddOns]
  69. KMFMX=C:\win31\Mkfmx.dll (put here the equivalent full path to the DLL)
  70.  
  71. [MkFmX]
  72. menuname=<Type here the name that you want to appear in the menu>
  73. programs=<Type the number of items in the menu>
  74. 1=title,progname,WorkingDir[,m]
  75. 2=<next item>
  76. ...
  77. ... <up to the last item>
  78.  
  79. Explanation of settings:
  80.  
  81. mnuname= defines the name of the item that will be added to the File
  82. Manager menu. Do not exceed 15 characters in length. If you want this
  83. menu to be activated by an ALT-combination, add the symbol & in front
  84. of the letter that should activate it. Example:
  85.  
  86. menuname=&Tools
  87.  
  88. adds the item Tools to the File manager menu, and associates the
  89. hotkey ALT-T with it.
  90.  
  91. programs= defines how many items will appear on the menu
  92.  
  93. The items are defined next, one per line, numbered according to
  94. the order you want them to appear on the menu.
  95.  
  96. Each item consists of the following parts, separated by commas:
  97.  
  98. a. Title. This is the word that will appear on the menu.
  99.     Like the menuname, it can have the & sign define an accelarator
  100.     letter. If the first letter is an underscore (_), this item
  101.     is separated from the previous one in the menu by a line.
  102.  
  103. b. program to execute. If the program is on the path, this can be
  104.    just the program name. Otherwise, it must be the full path name
  105.    to the program. It can have parameters as well.
  106.  
  107. c. Working directory. This is optional. If defined, the current
  108.    directory is changed to this setting before the program is run,
  109.    a la program manager.
  110.  
  111. d. The last item, if present can be one of the letters N,S,M and
  112.    defines how the file name parameters are passed to the program
  113.  
  114.    S (the default) means that a different instance is created
  115.    for each filename selected. Thus,if you select three files
  116.    and activate an entry that has this format:
  117.    notepad,notepad.exe,,S
  118.    you will get three copies of notepad running at the same time,
  119.    one for each file
  120.  
  121.    M signifies that the program can handle multiple parameters
  122.    (many MDI applications can do that). Turbo pascal for windows
  123.    is one such example. When multiple files are selected with this
  124.    setting, the program is called ONCE, with all the file names
  125.    passed as parameters on the command line. this results in multiple
  126.    windows being opened.
  127.  
  128.    N signifies that the program does not handle file name parameters.
  129.    The only reason you would put a selection like that in MKfmx's menu
  130.    is to use it as a quick program launcher. The functionality of
  131.    having a program like that act on the selected files is lost.
  132.    As you will see in the example,this has its uses.
  133.  
  134.    If in doubt about the capabilities of the program you are setting
  135.    up, leave this entry blank, which defaults to S (single parameter)
  136.  
  137. Here is an example:
  138.  
  139.  
  140. [AddOns]
  141. Mkfmx=C:\win31\MkfmX.dll
  142.  
  143. [MkFmX]
  144. menuname=&Addons
  145. programs=4
  146. 1=Notepad,notepad.exe
  147. 2=Ms,Ms.exe,,m
  148. 3=Paintbrush,paint.exe,c:\win31\paint
  149. 4=_Edit Winfile.ini,notepad.exe c:\win31\winfile.ini,,N
  150.  
  151. This adds the menu item Addons to the file manager menu. This menu
  152. contains 4 selections and looks like that:
  153.  
  154. Notepad
  155. Ms
  156. paintbrush
  157. -----------              <-- this line created by the _ in front
  158. Edit winfile.ini             of the last item
  159.  
  160. Item 1 starts notepad on the selected file(s)
  161. item 2 starts a DOS editor that can handle multiple parameters
  162. Item 3 starts paintbrush,changing directory to c:\win31\paint
  163. Item 4 allows you to edit the winfile.ini. This entry cannot be
  164.        used with selected files (the N parameter). It is used as
  165.        a handy way to configure MkFmx. (You will need to exit
  166.        and restart file manager for the changes to take effect)
  167.        This entry demonstrates also that the program executed can
  168.        have hard-wired parameters
  169.  
  170. Last, I have included a special capability, meant for those who
  171. want to modify and extend the source. The program will recognise
  172. in place of <programname> special "internal" commands. These should
  173. start with the sign @. When selected, instead of starting a program,
  174. they execute an command internal to MkFmX. Currently, there is only
  175. one such command:
  176.  
  177. @RELOAD will reload the MkFMx menu. This is usefull after having edited
  178. the winfile.ini file while file manager is active. So the line:
  179.  
  180. 5=Reload,@reload
  181.  
  182. will do just that.
  183.  
  184. Clearly, more internal commands like that can be added by programmers
  185.  
  186. Phew!!! It took me longer to write these instructions than the actual
  187. program itself! Again, if you like it please drop me a note.
  188. Programmers are vain people, and they want to know if their
  189. contributions are appreciated!
  190.  
  191.  
  192. Mike Cariotoglou,
  193. Singular Computer Applications,
  194. Athens,Greece
  195.  
  196. CIS 100012,1767
  197.  
  198.